<template>
  <div class="right-drawer" v-if="open">
    <div class="drawer-content">
      <img src="@/assets/closeArrow.png" alt="" class="close-sider-icon" @click="closeBtnClicked">
      <div>
        <iframe :src="reactAppUrl" style="width: 400px; height: 100vh;"></iframe>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const open = defineModel()
const reactAppUrl = ref('https://memo-mini.vercel.app/')

const closeBtnClicked = () => {
  open.value = false
}
</script>

<style lang="less" scoped>
  .right-drawer {
    width: 400px;
    background: rgb(239, 243, 255);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;

    .drawer-content {
      position: relative;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .close-sider-icon {
      box-sizing: border-box;
      position: absolute;
      top: 40px;
      left: -16px;
      width: 20px;
      height: 20px;
      cursor: pointer;
      padding: 2px;
      border-radius: 4px 0px 0px 4px;
      background: rgb(239, 243, 255);
    }
  }
</style>